import {
	mapState,
	mapMutations,
	mapGetters
} from 'vuex'

export default {
	data() {
		return {
			// address: {}
		}
	},
	methods: {
		...mapMutations('m_user', ['updataAddress']),
		async chooseAddress() {
			const [err, success] = await uni.chooseAddress().catch(err => err);
			if (err === null && success.errMsg === "chooseAddress:ok") {
				// this.address = success
				this.updataAddress(success)
			}
		}
	},
	computed: {
		...mapState('m_user', ['address']),
		...mapGetters('m_user', ['addstr'])
	}
}
